<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
</head>
<body>
    <span class="layui-breadcrumb" >
        <a ><cite><i class="fa fa-map-marker"></i>位置</cite></a>
        <a href="<?=site_url('news/admin/news')?>">新闻</a>
        <a href="<?=site_url('news/admin/look')?>">收费阅读记录</a>
    </span>
        <form class="layui-form layui-form-so" action="<?=site_url('news/admin/look')?>" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">新闻名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="key" value="<?=$key?>" class="layui-input">
                </div>
                <label class="layui-form-label">阅读时间</label>
                <div class="layui-input-inline">
                    <input style="width:90px;" name="kstime" id="kstime" type="text" value="<?=$kstime?>" class="layui-input" /> 
                </div>
                <div class="layui-input-inline">-</div>
                <div class="layui-input-inline">
                    <input style="width:90px;" name="jstime" id="jstime" value="<?=$jstime?>" type="text" class="layui-input" />
                </div>
                <div class="layui-input-inline">
                    <button class="layui-btn" type="submit">查询</button>
                </div>
            </div>
        </form>
        <form class="layui-form" action="<?=site_url('news/admin/look/del')?>" method="post">
            <table class="layui-table">
                <colgroup>
                    <col width="40">
                    <col>
                    <col>
                </colgroup>
                <thead>
                    <tr>               
                        <th>选</th>
                        <th class="phide">ID</th>
                        <th>标题</th>
                        <th>会员</th>
                        <th>扣币</th>
                        <th class="phide">时间</th>
                        <th class="phide">操作</th>
                    </tr>
                </thead>
                <tbody>
                <?php
                    if(empty($look)) echo '<tr><td align="center" height="50" colspan="7">没有找到相关记录~!</td></tr>';
                    foreach ($look as $row) {
                        //时间加亮
                        if(date('Y-m-d',$row->addtime)==date('Y-m-d')){
                            $addtime='<font color=red>'.date('Y-m-d H:i:s',$row->addtime).'</font>';
                        }else{
                            $addtime=date('Y-m-d H:i:s',$row->addtime);
                        }
                        echo '
                        <tr id="row_'.$row->id.'">
                        <td><input name="id['.$row->id.']" class="xuan" type="checkbox" value="'.$row->id.'" /></td>
                        <td class="phide">'.$row->id.'</td>
                        <td><a href="'.linkurl('show','id',$row->did,1,'news').'" target="play">'.$row->name.'</a></td>
                        <td>'.getzd('user','name',$row->uid).'</td>
                        <td>'.$row->cion.'</td>
                        <td class="phide">'.$addtime.'</td>
                        <td class="phide"><a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:cscms.del_one(\''.site_url('news/admin/look/del').'\','.$row->id.');">删除</a></td>
                        </tr> ';
                    }
                ?>
                </tbody>
            </table>
            <div class="more_func">
                <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.select_all();"><i class="fa fa-check colorl" ></i>全选/反选</a>
                <a class="layui-btn layui-btn-primary layui-btn-small" lay-submit lay-filter="del_pl"><i class="fa fa-close " style="color: red" ></i>删除选中</a>
                <div class="next-line">
                    <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.go_confirm('<?=site_url('news/admin/look/pldel')?>?id=3','确定删除3个月以前的记录？');" ><i class="fa fa-trash colord" ></i>删除3个月以前的记录</a>
                    <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.go_confirm('<?=site_url('news/admin/look/pldel')?>','确定要删除所有记录吗?');"><i class="fa fa-trash colorr" ></i>删除所有记录</a>
                </div>
            </div>
        </form>
        <div id="page">
            <div class="data_nums phide"><?=$page_data?></div>
            <div class="data_page"><?=$page_list?></div>
        </div>
    </div>
    <script type="text/javascript">
        cscms.init();
        cscms.mode('cscms.getTime(\'kstime\',\'date\')');
        cscms.mode('cscms.getTime(\'jstime\',\'date\')');
    </script>
</body>
</html>